package com.qqtech.qquan.user.service;

import java.util.ArrayList;
import java.util.List;

import javax.annotation.Resource;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;

import com.qqtech.core.frame.dao.BaseDao;
import com.qqtech.core.frame.service.BaseServiceImpl;

import com.qqtech.qquan.user.dao.UserShieldDao;
import com.qqtech.qquan.user.enums.UserShieldTypeDictEnum;
import com.qqtech.qquan.user.model.*;

@Service
public class UserShieldServiceImpl extends BaseServiceImpl<UserShield> implements UserShieldService {
	public static final Logger log = LoggerFactory.getLogger(UserShieldServiceImpl.class);

	@Resource
	private UserShieldDao userShieldDao;

	@Override
	protected BaseDao<UserShield> getBaseDao() {
		return userShieldDao;
	}

	@Override
	public List<Integer> getShieldUserIds(Integer creatorId, UserShieldTypeDictEnum userShieldTypeDictEnum) {
		List<Integer> shieldUserIds = new ArrayList<Integer>();
		UserShieldQuery userShieldQuery = new UserShieldQuery();
		userShieldQuery.setCreatorId(creatorId);
		userShieldQuery.setType(userShieldTypeDictEnum.getCode());
		List<UserShieldVo> list = userShieldDao.queryList(userShieldQuery);
		for (UserShieldVo userShieldVo : list) {
			shieldUserIds.add(userShieldVo.getShieldUserId());
		}
		return shieldUserIds;
	}

}